package com.wn.ziroom.controller;


import com.wn.ziroom.entity.Villages;
import com.wn.ziroom.service.VillagesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wangzhijia
 * @since 2023-02-23 02:27:54
 */
@Controller
@RequestMapping("/ziroom_portal/villages")
public class VillagesController {

    private VillagesService villagesService;

    @Autowired
    public void setVillagesService(VillagesService villagesService) {
        this.villagesService = villagesService;
    }

    @ResponseBody
    @PostMapping("/showVillages")
    public List<Villages> showVillages(@RequestParam("streetCode") Integer streetCode){
        return villagesService.findListByStreetCode(streetCode);
    }
}

